package com.cloud.sample.job;

import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class CleanJob extends IJobHandler {
    @Override
    @XxlJob("CleanJobHandler")
    public void execute() {
        String param = XxlJobHelper.getJobParam();
        log.info("param={}", param);
        try {
            // TODO
            XxlJobHelper.handleSuccess();
        } catch (Exception e) {
            log.error(e.getMessage(), e);
            XxlJobHelper.log(e);
            XxlJobHelper.handleFail();
        }
    }
}
